Skip to content

gh-151949: Fix Sphinx reference warnings in Doc/library/lzma.rst#153878

Merged
zware merged 6 commits into
python:mainfrom
fedonman:fix-gh-151949-lzma-sphinx-warnings
Jul 19, 2026
Merged

gh-151949: Fix Sphinx reference warnings in Doc/library/lzma.rst#153878
zware merged 6 commits into
python:mainfrom
fedonman:fix-gh-151949-lzma-sphinx-warnings

Conversation

@fedonman

@fedonman fedonman commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

The lzma module constants (FORMAT_*, CHECK_*, PRESET_*, the FILTER_* names, MODE_* and MF_*) were referenced with the :const: role all over Doc/library/lzma.rst, but none of them were actually defined as reference targets. In nitpicky mode this produced 35 "py:const reference target not found" warnings (the full list is in the issue).

This documents those constants with .. data:: directives, the same way signal, socket and ssl already do it, so the existing :const: references resolve to real linked entries. The inline descriptions of the format and check constants in LZMACompressor become short linked references, and their full descriptions now live in the new Constants section. The BCJ filter references that are deliberately suppressed (like FILTER_X86) are left alone, since they don't emit warnings.

I checked with a nitpicky docs build (sphinx-build -n -D nitpicky=1): all 35 warnings from lzma.rst are gone and no new ones appear.

Sub-issue of #151940.

The lzma module constants (FORMAT_*, CHECK_*, PRESET_*, FILTER_*, MODE_*
and MF_*) were referenced with the :const: role throughout the module
documentation but were never defined as reference targets, producing
"reference target not found" warnings under nitpicky mode.

Document these public constants with .. data:: directives, following the
convention used by the signal, socket and ssl modules, so the existing
references resolve. The now-redundant inline descriptions of the format
and check constants are condensed into linked references.
@read-the-docs-community

read-the-docs-community Bot commented Jul 18, 2026

Copy link
Copy Markdown

@fedonman

Copy link
Copy Markdown
Contributor Author

@zware part of EuroPython sprint.

@zware zware left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks!

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Jul 19, 2026
@zware
zware merged commit 1530b38 into python:main Jul 19, 2026
36 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Jul 19, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 19, 2026
@zware zware added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 19, 2026
@zware zware added the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 19, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @zware for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154125 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154126 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 19, 2026
@bedevere-app

bedevere-app Bot commented Jul 19, 2026

Copy link
Copy Markdown

GH-154127 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news sprint

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants